<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>权限管理</title>
	<link rel="stylesheet" type="text/css" href="../css/index.css"></link>
	<script src="../js/common.js"></script>
	<script src="../js/jquery.plugins/jquery.js"></script>
	<link rel="stylesheet" type="text/css" href="../js/jquery.plugins/easyui/css/default/easyui.css"></link>
	<link rel="stylesheet" type="text/css" href="../js/jquery.plugins/easyui/css/icon.css"></link>
	<script src="../js/jquery.plugins/easyui/jquery.easyui.min.js"></script>
	<script src="../js/jquery.plugins/easyui/easyui-lang-zh_CN.js"></script>
	<script>
		$(function(){
			$('#saveBtn').linkbutton({iconCls:'icon-save',text:"保存",plain:true});
			$('#backBtn').linkbutton({iconCls:'icon-back',text:"返回上一页",plain:true});
			$('#resetBtn').linkbutton({iconCls:'icon-reload',text:"重置",plain:true});
			
			$("#name").validatebox( {
				required:true,
				validType:"length[3,32]",
				missingMessage:"权限名称不能为空",
				invalidMessage:"权限名称在3到32个字符以内。"
			});
			$("#memo").validatebox( {
				validType:"length[0,256]",
				invalidMessage:"描述在0到128个字符以内。"
			});
			$("form").submit(function(){
					return checkValidate(['name','memo']);
				}	
			);
		});
	</script>
</head>
<body>
	<!-- 导航部分 -->
	<div class="position">
	您当前的位置：系统管理 &gt;&gt; <a href="list.ht">权限管理</a> &gt;&gt; 编辑权限信息
	</div>
	<!-- 导航部分结束 -->
	<!-- 表单部分开始 -->
	<div>
		<form action="save.ht" method="post">
			<input type="hidden" name="id" id="id" value="${model.id}"/>
			<input type="hidden" name="lev" id="lev" value="${model.lev}"/>
			<table class="form" style="width:50%;">
				<tr>
					<td class="title">名称：</td>
					<td><input type="text" style="width:200px;"  id="name" name="name" value="${model.name }"/></td>
				</tr>
				<tr>
					<td class="title">权限编号：</td>
					<td><input type="text" style="width:200px;"  id="code" name="code" value="${model.code }" readonly/></td>
				</tr>
				<tr>
					<td class="title">权限路径：</td>
					<td><input type="text" style="width:200px;"  id="path" name="path" value="${model.path }"/></td>
				</tr>
				<tr>
					<td class="title">是否为菜单：</td>
					<td>
						<input type="radio" name="menu" value="true" <c:if test="${model.menu==true}">checked</c:if>/>是
						<input type="radio" name="menu" value="false" <c:if test="${model.menu==false || model== null}">checked</c:if>/>否
					</td>
				</tr>
				<tr>
					<td class="title">状态：</td>
					<td>
						<input type="radio" name="status" value="true" <c:if test="${model.status==true || model == null}">checked</c:if>/>启用
						<input type="radio" name="status" value="false" <c:if test="${model.status==false}">checked</c:if>/>停用
					</td>
				</tr>
				<tr>
					<td class="title">所属权限：</td>
					<td>
						<select id="parentId" name="parentId">
							<option value="0">根...</option>
							<c:forEach var="permission" items="${permissions}">
								<option value="${permission.id}" <c:if test="${model.parentId==permission.id}">selected</c:if>><c:forEach begin="2" end="${permission.lev}" step="1">&nbsp;&nbsp;</c:forEach>${permission.name}</option>
							</c:forEach>
						</select><font class="error">所属权限为跟的为一级菜单</font>
					</td>
				</tr>
				<tr>
					<td class="title">简介：</td>
					<td><textarea id="memo" name="memo">${model.memo }</textarea></td>
				</tr>
				<tr>
					<td colspan="2" class="btntd">
					<a href="javascript:commit();" id="saveBtn">保存</a>
					<a href="javascript:reset();" id="resetBtn">重置</a>
					<a href="javascript:goBack();" id="backBtn">返回上一页</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<!-- 表单部分结束  -->
</body>
</html>